
First install Raspberry Pi Tools From LibreELEC Repo.

Copy folder "shutdown_scripts" to /storage

Run the following command via ssh putty

nano /storage/.config/autostart.sh

Add the following line to top of page:- "python /storage/shutdown_scripts/SafeShutdown.py &"
Press ctr+o to save changes (confirm by pressing Y) Press ctr+x to exit

Now run the next 4 commands via ssh putty
 
chmod +x /storage/shutdown_scripts/SafeShutdown.py

chmod +x /storage/shutdown_scripts/Shutdown_Button.sh

chmod +x /storage/shutdown_scripts/Restart_Button.sh

chmod +x /storage/.config/autostart.sh

reboot
 

